import request from "@/utils/request";
import qs from "qs";
// 详细数据
export const DetailList = (data) =>
  request.post("/api/v1/DataCaptureInstrument/DetailList", data);

export function VoluntarilyAllocationTaskAdds(data) {
  return request({
    url: "/api/v1/EntrustTask/VoluntarilyAllocationTaskAdds",
    method: "post",
    data,
  });
}

export function VoluntarilyAllocationTaskGetList(data) {
  return request({
    url: "/api/v1/EntrustTask/VoluntarilyAllocationTaskGetList",
    method: "post",
    data: data,
  });
}

export function TaskSampleDetectionItem(data) {
  return request({
    url: "/api/v1/EntrustTask/TaskSampleDetectionItem",
    method: "get",
    params: data,
  });
}
export function TaskSampleDetectionItemByTaskId(data) {
  return request({
    url: "/api/v1/EntrustTask/TaskSampleDetectionItemByTaskId",
    method: "get",
    params: data,
  });
}

export function GetTaskNumber(data) {
  return request({
    url: "/api/v1/EntrustTask/GetTaskNumber",
    method: "get",
    params: data,
  });
}

export function create(data) {
  return request({
    url: "/api/v1/EntrustTask/Create",
    method: "post",
    data,
  });
}

export function deleteRecord(data) {
  return request({
    url: "/api/v1/EntrustTask/Delete",
    method: "delete",
    data,
  });
}

export function update(data) {
  return request({
    url: "/api/v1/EntrustTask/Update",
    method: "post",
    data,
  });
}

export function TaskAllocation(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/TaskAllocation",
    method: "get",
    params: data,
  });
}

export function GetEntrustTaskSampleDetection(data) {
  return request({
    url: "/api/v1/EntrustTask/GetEntrustTaskSampleDetection",
    method: "post",
    data: data,
  });
}

export function entrustTaskUpdateDistribution(data) {
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskUpdateDistribution",
    method: "post",
    data,
  });
}

export function getEntrustTaskReceiveList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/GetEntrustTaskReceiveList",
    method: "get",
    params: data,
  });
}

export function entrustTaskReceiveUpdate(data) {
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskReceiveUpdate",
    method: "post",
    data,
  });
}

export function entrustTaskReassignmentUpdate(data) {
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskReassignmentUpdate",
    method: "post",
    data,
  });
}

export function entrustTaskResultList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskResultList",
    method: "get",
    params: data,
    paramsSerializer: (params) => qs.stringify(params, { indices: false }),
  });
}

export function EntrustTaskSampleInfoResultAdd(data) {
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskSampleInfoResultAdd",
    method: "post",
    data,
  });
}

export function entrustTaskSampleInfoResult(data) {
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskSampleInfoResult",
    method: "get",
    params: data,
  });
}

export function entrustTaskResultEntryList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskResultEntryList",
    method: "get",
    params: data,
  });
}

export function entrustTaskNoticedList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskNoticedList",
    method: "get",
    params: data,
  });
}

export function entrustTaskResultVerifyList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskResultVerifyList",
    method: "get",
    params: data,
  });
}
export function entrustTaskVerifyList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/EntrustTaskVerifyList",
    method: "get",
    params: data,
  });
}
export function getElnAppTaskList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/GetElnAppTaskList",
    method: "get",
    params: data,
  });
}
export function getElnAppTaskDetectionList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/getElnAppTaskDetectionList",
    method: "get",
    params: data,
  });
}
export function getDetecitionTask(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "/api/v1/EntrustTask/GetDetecitionTask",
    method: "get",
    params: data,
  });
}
